<?php

$config = [
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => '4CHWiL07DLKx4o65fe7zPx-mUyNJZCQu',
        ],
        'urlManager' => [
        // here is your normal backend url manager config
             'enablePrettyUrl' => true, //路由的路径化，通過.htaccess配置了
             'showScriptName' => false,// 这一步是将代码里链接的index.php隐藏掉。
//             'suffix' => '.html',//加入假后缀
//             'urlFormat'=>'path',
//             'rules'=>array(
//                 '<controller:\w+>/<id:\d+>'=>'<controller>/view',
//                 '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
//                 '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

//             ),
        ],
        'request'=>array(
            // Enable Yii Validate CSRF Token
            'enableCsrfValidation' => true,
        ),
        /*'urlManagerFrontend' => [
        // here is your frontend URL manager config
        ], */
    ],
];

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        //by jois add 限制访问IP
        'allowedIPs' => ['127.0.0.1', '192.168.0.*'],
    ];
}

return $config;
